<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    request.setAttribute("basePath",basePath);
%>
<!DOCTYPE>
<html>
<head>
    <title>明细信息</title>
    <%@ include file="/resources/js/easyui/taglibs.jsp"%>
    <%@ include file="/resources/js/easyui/_easyui.jsp"%>
    <%@ include file="/resources/js/easyui/_message.jsp"%>
    <%@ include file="/resources/js/easyui/_viewJS.jsp"%>
</head>

<body class="easyui-layout">
    <form id="addform" >
        <table class="tableForm" style="width: 100%;">
            <tr>
                <th align="right" valign="top"><span class="redStart">*</span><label>APP文件：</label></th>
                <td><input class="easyui-filebox" name="app" data-options="prompt:'请选择APP安装包...'" style="width:200px" /></td>
            </tr>

            <tr>
                <th align="right" valign="top"><span class="redStart">*</span><label>APP版本号：</label></th>
                <td><input class="easyui-textbox" name="version" style="width:200px" /></td>
            </tr>

            <tr>
                <th align="right" valign="top"><span class="redStart">*</span><label>更新内容：</label></th>
                <td><input class="easyui-textbox" data-options="multiline:true" name="changecontent" style="width:200px;height:200px" /></td>
            </tr>

        </table>

    </form>

<script type="application/javascript">
    function add(){

        var formData = new FormData($( "#addform")[0]);

        $.ajax({
                url:'${basePath}web/release/uplaodapp',
                type : 'POST',
                data : formData,
                processData: false,
                contentType: false,
                error: function (response) {
                    ViewHelper.func.ajaxErrorMessage(response);
                },
                success: function (ret) {
                    if(ret.result) {
                        $.messager.alert('提示信息！',ret.info,'info');
                        parent.view.closeAddWin(1);
                        $("#addform").form('clear');
                    }else{
                        $.messager.alert('提示',ret.info,'error');
                    }
                }
            });
    }
</script>
</body>
</html>
